<template>
  <!-- 添加会场 -->
  <div class="lfy_add_box">
    <div style="height: 20px;"></div>
    <i class="el-icon-arrow-left" @click="backAdd"></i>
    <div class="add_container">
      <el-form
        ref="form"
        :model="form"
        label-width="80px"
        label-position="left"
      >
        <!--  -->
        <el-form-item label="会场名">
          <el-input class="huichang_name" v-model="form.name"></el-input>
        </el-form-item>
        <!--  -->
        <el-form-item label="开始时间">
          <el-col :span="11">
            <el-date-picker
              type="date"
              placeholder="选择日期"
              v-model="form.date1"
              style="width: 100%;"
            ></el-date-picker>
          </el-col>
        </el-form-item>
        <!--  -->
        <el-form-item label="状态" class="mar_bottom">
          <el-radio-group v-model="form.resource">
            <el-radio label="启用"></el-radio>
            <el-radio label="禁用"></el-radio>
          </el-radio-group>
        </el-form-item>
        <!--  -->
        <el-form-item>
          <el-button type="primary" @click="addhall">确定</el-button>
          <el-button @click="backAdd">取消</el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>
<script>
import {addconference  } from '../../api/index'

// import shijianc from './time'

export default {
  // 表单
  data() {
    return {
      form: {
        name: '',
        date1: '',
        resource: '',
      },
      // addobj: {},
    }
  },
  methods: {
    // 路由
    // 返回添加会场
    backAdd() {
      this.$router.push('/seckillAdmin')
    },

    // 添加会场
    addhall() {
      let a = this.form.date1
      let b = this.form.date1
      var obj = {
        name: this.form.name,
        state: this.form.resource,
        time: '2020-10-09',
        createTime: '2020-10-09',
        count: 20,
      }
      addconference(obj).then((res) => {
        console.log(res)
        if (res.code == 200) {
          this.backAdd()
        }
      })
    },
  },
}
</script>

<style lang="scss">
* {
  box-sizing: border-box;
}

.lfy_add_box {
  padding: 0 30px;
}

.el-icon-arrow-left {
  font-size: 20px;
}

.add_container {
  padding-left: 30px;
}
.huichang_name {
  width: 40%;
}
.el-form-item {
  margin-bottom: 40px;
}
.mar_bottom {
  margin-bottom: 60px;
}
</style>
